<?php

$doc = new DOMDocument();
$doc->formatOutput = true;
$doc->Load("clientResources/php/map/xml/groups.xml");

$groups = $doc->documentElement;

$b = $doc->createElement("grupo");
$b->setAttribute("id",12);

$permAsk = $doc->createElement("permissionAsk");
$permAsk->appendChild(
		$doc->createTextNode("0" )
);
$b->appendChild( $permAsk );
//////////////////////////////////////
$numAuth = $doc->createElement("numAuthorizations");
$numAuth->appendChild(
		$doc->createTextNode( "0" )
);
$b->appendChild( $numAuth );
/////////////////////////////////////
$grant = $doc->createElement("accessGrant");
$grant->appendChild(
		$doc->createTextNode( "0" )
);
$b->appendChild( $grant );


$groups->appendChild( $b );

$doc->save("clientResources/php/map/xml/groups.xml");